package com.selfdriving.activity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.selfdriving.BaseFragmentActivity;
import com.selfdriving.R;
import com.selfdriving.bean.TogetherPlayExamineBean;

public class TogetherPlayExamine extends BaseFragmentActivity
{

	ImageView img;
	TextView name;
	TextView content;
	TextView text1;
	TextView text2;
	TextView text3;
	TextView text4;
	TextView text5;
	TextView text6;
	TextView text7;
	TextView text8;
	TextView text9;
	TextView text10;
	TextView text11;
	TextView text12;
	TextView text13;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		super.setContentView(R.layout.activity_together_play_examine);
		initViews();
		initEvents();
	}

	@Override
	protected void initViews()
	{
		img = (ImageView) findViewById(R.id.user_item_iv_avatar);
		name = (TextView) findViewById(R.id.uname);
		content = (TextView) findViewById(R.id.content);
		text1 = (TextView) findViewById(R.id.together_start_travel_text1);
		text2 = (TextView) findViewById(R.id.together_start_travel_text2);
		text4 = (TextView) findViewById(R.id.together_start_travel_text4);
		text5 = (TextView) findViewById(R.id.together_start_travel_text5);
		text6 = (TextView) findViewById(R.id.together_start_travel_text6);
		text7 = (TextView) findViewById(R.id.together_start_travel_text7);
		text8 = (TextView) findViewById(R.id.together_start_travel_text8);
		text9 = (TextView) findViewById(R.id.together_start_travel_text9);
		text10 = (TextView) findViewById(R.id.together_start_travel_text10);
		text11 = (TextView) findViewById(R.id.together_start_travel_text11);
		text12 = (TextView) findViewById(R.id.together_start_travel_text12);
		text13 = (TextView) findViewById(R.id.together_start_travel_text13);

	}

	@Override
	protected void initEvents()
	{
		TogetherPlayExamineBean play = (TogetherPlayExamineBean) mApplication.togetherList
				.get(0);
		mApplication.imageLoader.displayImage(play.getHeadImg(), img,
				mApplication.options);
		name.setText(play.getOriginate());
		content.setText(play.getPhone());
		text1.setText(play.getDestination());
		text2.setText(play.getTimes());
		text4.setText(play.getGoDate());
		text5.setText(play.getSex());
		text6.setText(play.getDays());
		text7.setText(play.getCar());
		String st = "";
		String status = play.getStatus();
		if (status.equals("0"))
		{
			st = "单对单";
		} else if (status.equals("1"))
		{
			st = "情人结伴";
		} else if (status.equals("2"))
		{
			st = "家庭结伴";
		} else if (status.equals("3"))
		{
			st = "多对多";
		} else if (status.equals("9"))
		{
			st = "不限";
		}
		text8.setText(st);
		text9.setText(play.getFee());
		text10.setText(play.getPeoples());
		text13.setText(play.getRoute());
		text12.setText(play.getDeclaration());
		text11.setText(play.getFrom());
	}

	@Override
	public void onBackPressed()
	{
		finish();
	}
}
